package net.hn.hnms.biz.plan.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.hn.hnms.biz.plan.domain.ExecutionOther;
import net.hn.hnms.biz.plan.vo.ExecutionOtherVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface ExecutionOtherMapper extends BaseMapper<ExecutionOther> {


    @Select("<script>" +
            " select " +
            " sum(people_count) as totalPeopleCount," +
            " sum(repair) as totalRepair," +
            " sum(grout) as totalGrout," +
            " sum(nitrogen) as totalNitrogen," +
            " sum(gasext) as totalGasext" +
            " from execution_other " +
            " where del_flag ='0' and  mine_code =   #{mineCode} " +
            "</script>")
    ExecutionOtherVO selectExecutionOtherTotalByMineCode(@Param("mineCode") String mineCode);

    @Select("<script>" +
            " select " +
            " sum(people_count) as totalPeopleCount," +
            " sum(repair) as totalRepair," +
            " sum(grout) as totalGrout," +
            " sum(nitrogen) as totalNitrogen," +
            " sum(gasext) as totalGasext" +
            " from execution_other " +
            " where del_flag ='0' and  company_code =   #{mineCode} " +
            "</script>")
    ExecutionOtherVO selectExecutionOtherTotalByCompanyCodeOrName(@Param("mineCode") String mineCode);
}
